const API = require('../../../../pages/api/index')
const { typeJson } = require('../../../../utils/typejson')
let prolist = wx.getStorageSync('prolist')==''?wx.getStorageSync('prolist'):JSON.parse(wx.getStorageSync('prolist'))







Page({

  /**
   * 页面的初始数据
   */
  data: {
    pulldown:"",
    pullup:2,
    addButton:true,
    Refresh:false,
    prolist:wx.getStorageSync('prolist')==''?wx.getStorageSync('prolist'):JSON.parse(wx.getStorageSync('prolist')),
    
    listConfig: [
      {
        label: '设备名称',
        prop: 'deviceName'
      },
 
      {
        label: '检查时间',
        prop: 'checkTime',
        
      }
    ],

    slide: {
      slideButton: {
        type: 'warn',
        text: '检查',
        extClass: 'test',
          src: '/page/weui/cell/icon_star.svg', // icon的路径
      },
      formConfig: [
        {
          label: "设备类型",
          prop: "deviceType",
          jsonType: typeJson.deviceTypeD,
          type: 'dropDown',
          required:true,
        },
        {
          label: '设备名称',
          prop: 'deviceId',
          type: 'multiDropDown',
          hidden: 'look',
          required:true,
          net: {
            url: '/app/LineEquipment/getappList',
            method: 'post',
            key: 'id',
            data:{
              mineId: true,
            },
            value: 'deviceName'
          }
        },
        {
          label: "检查时间",
          prop: "checkTime",
          type:"date",
          required:true,
        },
       
        {
          label: "检查人",
          prop: "checkMan",
        },

        {
          label: "设备状态",
          prop: "deviceStatus",
          jsonType: typeJson.deviceStatuscolon,
          type: 'dropDown',
          required:true,
        },

        {
          label: "检查情况",
          prop: "checkInfo",
          type:"textarea"
        },

      ]
    },

 
      formConfig: [

        {
          label: "设备类型",
          prop: "deviceType",
          jsonType: typeJson.deviceTypeD,
          type: 'dropDown',
          required:true,
        },
     
      
         {
          label: '设备名称',
          prop: 'deviceId',
          type: 'multiDropDown',
          hidden: 'look',
          required:true,
          net: {
            url: '/app/LineEquipment/getappList',
            method: 'post',
            key: 'id',
            data:{
              mineId: true,
            },
            value: 'deviceName'
          }
        },
        {
          label: "检查时间",
          prop: "checkTime",
          type:"date",
          required:true,
        },
       
        {
          label: "检查人",
          prop: "checkMan",
        },

        {
          label: "设备状态",
          prop: "deviceStatus",
          jsonType: typeJson.deviceStatuscolon,
          type: 'dropDown',
          required:true,
        },

        {
          label: "检查情况",
          prop: "checkInfo",
          type:"textarea"
        },
       
        
       
       
       
       

        ],
    
        
        net: {
       
            select: {
              url: `/app/LineEquipment/getList`,
              method: 'post',
              data: {
                mineId: true,
                
              }
            },
            delete: {
              url: '/app/LineEquipment/delete',
              method: 'post',
              data: {
                
              }
            },
            insert: {
              url: '/app/LineEquipment/insert',
              method: 'post',
              data: {
                mineId:true,
              
               
              }
            },
            update: {
              url: '/app/LineEquipment/update',
              method: 'post',
              data: {
  
              }
            } 
        },
        showCom:true
      },

     
  
      
  /**
   * 生命周期函数--监听页面加载
   */


  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },
  
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
   
    
    this.setData({
      showCom:false
    })

    this.setData({
      showCom:true
    })
  },

 

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    wx.showLoading({
      title: '刷新中...',
    })
    this.setData({
      Refresh:true
    })
    wx.hideLoading();
    wx.stopPullDownRefresh()
    this.setData({
      Refresh:false
    })
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    this.setData({
      pullup: this.data.pullup + 1
    })
  },


  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})